package com.onefish.toolkit;

import cn.hutool.core.date.DateUtil;
import cn.hutool.cron.timingwheel.SystemTimer;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
//@EnableScheduling
public class TimerTask {
    @Scheduled(fixedDelay = 1000 * 10, initialDelay = 1000)
    public void test() {
        String threadName = Thread.currentThread().getName();
        String now = DateUtil.now();
        System.out.println("[" + now + "] threadName-" + threadName + "--------> test");
    }
    @Scheduled(fixedDelay = 1000 * 10, initialDelay = 1000)
    public void test2() {
        String threadName = Thread.currentThread().getName();
        String now = DateUtil.now();
        System.out.println("[" + now + "] threadName-" + threadName + "--------> test2");
    }


}
